<?php

class App_Controllers_index
{
    private $_template;
    private $_models = array();

    public function  __construct()
    {
        
    }

    public function index($request)
    {
        $this->_models['article'] = new App_Models_Article();
        $this->_models['photos'] = new App_Models_Photo();
                $this->_models['video'] = new App_Models_Video();
        $this->_template = new Core_Template();
        

        $this->_template->add_css_file(array('/App/Views/index.css',
                                            '/App/Views/index/index.css',
                                            '/App/Views/slider/slider.css'
                                            
                                ));
        $this->_template->add_js_file(array('/App/Views/js/jquery.js',
                                            '/App/Views/js/s3Slider.js',
                                            '/App/Views/js/slider.js',
                                            '/App/Views/js/tabs.js'


                                ));

        $this->_template->set_title("театр теней fireflies");
      
        $this->_template->get_smarty()->assign('title',$this->_template->get_title());
        $this->_template->get_smarty()->assign('css_file',$this->_template->get_css_file());
        $this->_template->get_smarty()->assign('js_file',$this->_template->get_js_file());

        $this->_template->get_smarty()->assign('article',$this->_models['article']->get_articles());

        
        $this->_template->get_smarty()->assign('photo',$this->_models['photos']->get_random_foto());
        $this->_template->get_smarty()->assign('video',$this->_models['video']->get_videos());
        $this->_template->get_smarty()->assign('content','index/index');
        $this->_template->get_smarty()->display('index.tpl');

    }

    public function __call($name, $args)
    {
        $this->_template = new Core_Template();
        $this->_template->error_page();
    }
}

?>
